package day36;
import java.util.*;

public class A1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int a = in.nextInt();
            //1.逆序 -- 转String
            //2.遍历+去重 -- 哈希表
            //3.记录答案 -- 用字符串记录
            String s = String.valueOf(a);
            int[] hash = new int[10];
            StringBuilder ret = new StringBuilder();
            for(int i=s.length()-1;i>=0;i--) {
                char ch = s.charAt(i);
                if(hash[ch-'0'] == 0) {
                    ret.append(ch);
                    hash[ch-'0']++;
                }
            }
            System.out.println(Integer.parseInt(ret.toString()));
        }
    }
}
